package com.mt.roll.core.dal.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;

import com.mt.roll.core.vo.PageVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 工单执行表
 * </p>
 *
 * @author mt
 * @since 2022-03-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_work_order_execute")
public class WorkOrderExecute extends Model<WorkOrderExecute> implements PageVo.ConvertVo{

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
      @TableId("id")
    private Long id;

    /**
     * 删除标志，是否有效:1 可用 0不可用
     */
    @TableField("valid")
    @TableLogic
    private Integer valid;

    /**
     * 添加时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 创建人id
     */
    @TableField("creator_id")
    private Integer creatorId;

    /**
     * 更新人id
     */
    @TableField("updater_id")
    private Integer updaterId;

    /**
     * 修改时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;

    /**
     * 版本号 默认为 1
     */
    @TableField("version")
    @Version
    private String version;

    /**
     * 工单状态：1、未激活，2、等待，3、激活，4、暂停，9、完成
     */
    @TableField("status")
    private Integer status;

    /**
     * 内部编码，系统自动生成
     */
    @TableField("inter_code")
    private String interCode;

    /**
     * 编码
     */
    @TableField("code")
    private String code;

    /**
     * 工单号，00B下发到00A工单编码
     */
    @TableField("work_order_no")
    private String workOrderNo;

    /**
     * 名称
     */
    @TableField("name")
    private String name;

    /**
     * 开始生产时间，第一片基板信息从设备获取，基板信息待人工单信息，	  																							通过工单编码获取时间，程序规则：检测到新的工单编码，	  																							把给定新的工单编码放到redis，同时清除掉redis旧的工单信息信息，每片基板都带有工单信息
     */
    @TableField("start_produce_time")
    private LocalDateTime startProduceTime;

    /**
     * 工艺号，00B下发到00A
     */
    @TableField("work_craft_no")
    private String workCraftNo;

    /**
     * 工艺名称
     */
    @TableField("craft_name")
    private String craftName;

    /**
     * 类型：1、生产工单，2、重工工单，3、测试工单
     */
    @TableField("type")
    private BigDecimal type;

    /**
     * 优先级：1、低，2、正常，3、高
     */
    @TableField("priority")
    private BigDecimal priority;

    /**
     * 计划生产数量
     */
    @TableField("plan_quantity")
    private BigDecimal planQuantity;

    /**
     * 实际生产数量
     */
    @TableField("actual_quantity")
    private BigDecimal actualQuantity;

    /**
     * 废片数量
     */
    @TableField("scrap_quantity")
    private BigDecimal scrapQuantity;

    /**
     * 工单发起方：1、MES，2、ERP，3、PID1，4、00A，5、00C
     */
    @TableField("trigger_origin")
    private BigDecimal triggerOrigin;

    /**
     * 工单发起时间
     */
    @TableField("trigger_time")
    private LocalDateTime triggerTime;

    /**
     * 描述
     */
    @TableField("description")
    private String description;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;

    /**
     * 分工艺号
     */
    @TableField("sub_proccess_no")
    private String subProccessNo;

    /**
     * 分工艺名字
     */
    @TableField("sub_proccess_name")
    private String subProccessName;

    /**
     * 工艺id
     */
    @TableField("process_id")
    private BigDecimal processId;

    /**
     * 工艺设备集合
     */
    @TableField("process_equipment_gather")
    private String processEquipmentGather;

    /**
     * 工艺集合
     */
    @TableField("process_gather")
    private String processGather;

    /**
     * 工单结束时间
     */
    @TableField("finish_produce_time")
    private LocalDateTime finishProduceTime;


    public static final String ID = "id";

    public static final String VALID = "valid";

    public static final String CREATE_TIME = "create_time";

    public static final String CREATOR_ID = "creator_id";

    public static final String UPDATER_ID = "updater_id";

    public static final String UPDATE_TIME = "update_time";

    public static final String VERSION = "version";

    public static final String STATUS = "status";

    public static final String INTER_CODE = "inter_code";

    public static final String CODE = "code";

    public static final String WORK_ORDER_NO = "work_order_no";

    public static final String NAME = "name";

    public static final String START_PRODUCE_TIME = "start_produce_time";

    public static final String WORK_CRAFT_NO = "work_craft_no";

    public static final String CRAFT_NAME = "craft_name";

    public static final String TYPE = "type";

    public static final String PRIORITY = "priority";

    public static final String PLAN_QUANTITY = "plan_quantity";

    public static final String ACTUAL_QUANTITY = "actual_quantity";

    public static final String SCRAP_QUANTITY = "scrap_quantity";

    public static final String TRIGGER_ORIGIN = "trigger_origin";

    public static final String TRIGGER_TIME = "trigger_time";

    public static final String DESCRIPTION = "description";

    public static final String REMARK = "remark";

    public static final String SUB_PROCCESS_NO = "sub_proccess_no";

    public static final String SUB_PROCCESS_NAME = "sub_proccess_name";

    public static final String PROCESS_ID = "process_id";

    public static final String PROCESS_EQUIPMENT_GATHER = "process_equipment_gather";

    public static final String PROCESS_GATHER = "process_gather";

    public static final String FINISH_PRODUCE_TIME = "finish_produce_time";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
